package More;

public class Animal {
    String name;
    int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class Dog extends Animal implements Irun,ISwimming{

    public Dog(String name, int age) {
        super(name, age);
    }

    @Override
    public void run() {
        System.out.println(name + "正在跑");
    }

    @Override
    public void swim() {
        System.out.println(name + "正在游泳");
    }
}
class fish extends Animal implements ISwimming {

    public fish(String name, int age) {
        super(name, age);
    }


    @Override
    public void swim() {
        System.out.println(name + "正在游");
    }
}
class Duck extends Animal implements Irun,ISwimming,Ifly {


    public Duck(String name, int age) {
        super(name, age);
    }

    @Override
    public void swim() {
        System.out.println(name + "正在游");
    }

    @Override
    public void fly() {
        System.out.println(name + "正在飞");

    }

    @Override
    public void run() {
        System.out.println(name + "正在跑");

    }
}